
# Replication file for
# Maggie Shum
# When Voting Turnout Becomes Contentious Repertoire: How Anti-ELAB Protest Overtook the District Council Election in Hong Kong 2019


rm(list = ls())
library(plyr)
library(dplyr)
library(tidyr)
library(RColorBrewer)
library(ggplot2)

cbbPalette <- c("#000000", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")

rad = read.csv(file = "anti_ELAB_radicalization.csv", header = TRUE)
rad_long = gather(rad, condition, percentage, force_gov:radical_ok, factor_key = TRUE)
rad_long$Date = factor(rad_long$Date, levels=c("12-Jun","16-Jun","17-Jun","21-Jun","26-Jun",
                                               "1-Jul","21-Jul","27-Jul","4-Aug","10-Aug","11-Aug",
                                               "13-Aug","16-Aug","18-Aug","25-Aug",
                                               "15-Sep","14-Oct","20-Oct"), ordered = TRUE)
rad_gg = ggplot(na.omit(rad_long), aes(Date, percentage, group=condition, color=condition)) +
  geom_line() +
  geom_point() +
  theme_classic()+
  scale_color_manual(values=cbbPalette)+
  xlab("Date") + ylab("Percent") +
  theme(axis.text.x = element_text(angle=45, hjust=1),
        axis.line = element_blank(),
        axis.ticks.x = element_blank(),
        panel.grid.major.y = element_blank(),
        legend.title = element_blank())+
  theme(legend.position = "bottom")


